# find Chart.yaml in  path  /var/ftp/acmis/helm
charts=$(find /var/ftp/acmis/helm|grep values.yaml)
for chart in $charts
do
echo "-----------${chart}"
# dirs of current chart,such as drill and spark
dir_name=$(echo $chart|awk -F"/" '{print $6}')
echo "dir_name is $dir_name"

# modify   hub: registry.cn-chengdu.aliyuncs.com to  hub: registry.cn-chengdu.aliyuncs.com
# modify   namespace: sunwu to idis-edu
# modify   repository: acmis-sqoop to the dir_name
echo $chart|xargs -t -I {} sed -i 's/hub: registry.cn-chengdu.aliyuncs.com/hub: registry.cn-chengdu.aliyuncs.com/'   {}
echo $chart|xargs -t -I {} sed -i 's/namespace: .*/namespace: idis-edu/'  {}
echo $chart|xargs -t -I {} sed -i "s/repository: .*/repository: ${dir_name}/"    {}
done

#echo $chart
